//
//  UUOrderVC.m
//  UUCharterSupplier
//
//  Created by ZhangAo on 14/01/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import "UUOrderVC.h"
#import "UUOrderStateListVC.h"

@interface UUOrderVC ()

@end

@implementation UUOrderVC

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = @"订单";
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSMutableArray *itemMenu = [[NSMutableArray alloc] initWithCapacity:0];
    DKPagingMenuItem *item1 = [[DKPagingMenuItem alloc] initWithTitle:@"待服务"
                                                   menuViewController:[UUOrderStateListVC orderStateListVCWithStatus:UUOrderStatusWaitingForService]];
    [itemMenu addObject:item1];
    
    DKPagingMenuItem *item2 = [[DKPagingMenuItem alloc] initWithTitle:@"待确认"
                                                   menuViewController:[UUOrderStateListVC orderStateListVCWithStatus:UUOrderStatusWaitingForConfirm]];
    [itemMenu addObject:item2];
    
    DKPagingMenuItem *item3 = [[DKPagingMenuItem alloc] initWithTitle:@"待分配"
                                                   menuViewController:[UUOrderStateListVC orderStateListVCWithStatus:UUOrderStatusWaitingForAssign]];
    [itemMenu addObject:item3];
    
    DKPagingMenuItem *item4 = [[DKPagingMenuItem alloc] initWithTitle:@"服务中"
                                                   menuViewController:[UUOrderStateListVC orderStateListVCWithStatus:UUOrderStatusInService]];
    [itemMenu addObject:item4];
    
    DKPagingMenuItem *item5 = [[DKPagingMenuItem alloc] initWithTitle:@"全部"
                                                   menuViewController:[UUOrderStateListVC orderStateListVCWithStatus:UUOrderStatusNone]];
    [itemMenu addObject:item5];
    
    UUPagingMenuController *pagingMenuController = [[UUPagingMenuController alloc] initWithItems:itemMenu];
    [self addChildViewController:pagingMenuController];
    [self.view addSubview:pagingMenuController.view];
    [pagingMenuController.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_topLayoutGuideBottom);
        make.bottom.equalTo(self.mas_bottomLayoutGuideTop);
        make.left.right.mas_equalTo(0);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
